In the "Spelling and Grammar" window, the Cancel button closes this window, and does not save the changes you have made.